<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}"/>
  <meta name="keywords" content="{{ with .Params.tags -}}{{ delimit . ", "}}{{- end }}"/>
  <meta name="copyright" content="1995-2021 The FreeBSD Foundation">
  <link rel="canonical" href="{{ .Permalink }}" />

  <title>{{ with .Params.Title }}{{ . }} | {{ end }} {{ block "title" . }}{{ .Site.Title }}{{ end }}</title>

  <meta name="theme-color" content="#790000">
  <meta name="color-scheme" content="light dark high-contrast">

  {{ if $.Site.Params.isOnline }}
    <link rel="shortcut icon" href="{{ absLangURL ($.Site.BaseURL) }}favicon.ico">

    {{- $styles := resources.Get "styles/main.scss" | resources.ToCSS | resources.Minify }}
    <link rel="stylesheet" href="{{ $styles.Permalink }}">
    <link rel="stylesheet" href="{{ absLangURL ($.Site.BaseURL) }}css/font-awesome-min.css">

    {{- $themeChooser := resources.Get "js/theme-chooser.js" | resources.Minify }}
    <script defer src="{{ $themeChooser.RelPermalink }}"></script>

    {{- $copyClipboard := resources.Get "js/copy-clipboard.js" | resources.Minify }}
    <script defer src="{{ $copyClipboard.RelPermalink }}"></script>

    {{- $search := resources.Get "js/search.js" | resources.Minify }}
    <script defer src="{{ $search.RelPermalink }}"></script>
  {{ else }}
    <link rel="shortcut icon" href="/favicon.ico">

    {{- $styles := resources.Get "styles/main.scss" | resources.ToCSS | resources.Minify }}
    <link rel="stylesheet" href="{{ $styles.RelPermalink }}">
    <link rel="stylesheet" href="/css/font-awesome-min.css">

    {{- $themeChooser := resources.Get "js/theme-chooser.js" | resources.Minify }}
    <script defer src="{{ $themeChooser.RelPermalink }}"></script>

    {{- $copyClipboard := resources.Get "js/copy-clipboard.js" | resources.Minify }}
    <script defer src="{{ $copyClipboard.RelPermalink }}"></script>

    {{- $search := resources.Get "js/search.js" | resources.Minify }}
    <script defer src="{{ $search.RelPermalink }}"></script>
  {{ end }}

  <!-- SEO -->
  {{ if $.Site.Params.isOnline }}
    <meta name="twitter:card" content="summary"/>
    <meta name="twitter:domain" content="docs.FreeBSD.org"/>
    <meta name="twitter:site" content="@freebsd"/>
    <meta name="twitter:url" content="https://twitter.com/freebsd"/>
    <meta property="og:title" content="{{ if .IsHome }}{{ .Site.Params.Title }}{{ else }}{{ .Title }}{{ end }}" />
    <meta property="og:description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" />
    <meta property="og:type" content="website"/>
    <meta property="og:image" content="{{ absLangURL ($.Site.BaseURL) }}favicon.ico"/>
    <meta property="og:image:alt" content="FreeBSD Logo">
    <meta property="og:locale" content="{{ $.Site.Language.Lang | default "en" }}" />
    <meta property="og:url" content="{{ .Permalink }}" />
    <meta property="og:site_name" content="{{ .Site.Title }}" />
    <script type="application/ld+json">
      {
        "@context": "http://schema.org",
        "@type": "Article",
        "url": "{{ .Permalink }}",
        "name": "{{ .Site.Title }}",
        "headline": "{{ .Site.Title }}",
        "description": "{{ .Site.Params.description }}"
      }
    </script>
    <!-- END SEO -->

  {{ end }}
</head>

